Optimal. Leaf size=95 \[ a b e x+\frac {b^2 e (c+d x) \tanh ^{-1}(c+d x)}{d}-\frac {e \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {b^2 e \log \left (1-(c+d x)^2\right )}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 95, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {6242, 12, 6037,
6127, 6021, 266, 6095} \begin {gather*} \frac {e (c+d x)^2 \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}-\frac {e \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+a b e x+\frac {b^2 e \log \left (1-(c+d x)^2\right )}{2 d}+\frac {b^2 e (c+d x) \tanh ^{-1}(c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 266
Rule 6021
Rule 6037
Rule 6095
Rule 6127
Rule 6242
Rubi steps
\begin {align*} \int (c e+d e x) \left (a+b \tanh ^{-1}(c+d x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int e x \left (a+b \tanh ^{-1}(x)\right )^2 \, dx,x,c+d x\right )}{d}\\ &=\frac {e \text {Subst}\left (\int x \left (a+b \tanh ^{-1}(x)\right )^2 \, dx,x,c+d x\right )}{d}\\ &=\frac {e (c+d x)^2 \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}-\frac {(b e) \text {Subst}\left (\int \frac {x^2 \left (a+b \tanh ^{-1}(x)\right )}{1-x^2} \, dx,x,c+d x\right )}{d}\\ &=\frac {e (c+d x)^2 \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {(b e) \text {Subst}\left (\int \left (a+b \tanh ^{-1}(x)\right ) \, dx,x,c+d x\right )}{d}-\frac {(b e) \text {Subst}\left (\int \frac {a+b \tanh ^{-1}(x)}{1-x^2} \, dx,x,c+d x\right )}{d}\\ &=a b e x-\frac {e \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {\left (b^2 e\right ) \text {Subst}\left (\int \tanh ^{-1}(x) \, dx,x,c+d x\right )}{d}\\ &=a b e x+\frac {b^2 e (c+d x) \tanh ^{-1}(c+d x)}{d}-\frac {e \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}-\frac {\left (b^2 e\right ) \text {Subst}\left (\int \frac {x}{1-x^2} \, dx,x,c+d x\right )}{d}\\ &=a b e x+\frac {b^2 e (c+d x) \tanh ^{-1}(c+d x)}{d}-\frac {e \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {e (c+d x)^2 \left (a+b \tanh ^{-1}(c+d x)\right )^2}{2 d}+\frac {b^2 e \log \left (1-(c+d x)^2\right )}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.04, size = 134, normalized size = 1.41 \begin {gather*} e \left (\frac {a b (c+d x)}{d}+\frac {a^2 (c+d x)^2}{2 d}+\frac {b (c+d x) (b+a (c+d x)) \tanh ^{-1}(c+d x)}{d}+\frac {\left (-b^2+b^2 (c+d x)^2\right ) \tanh ^{-1}(c+d x)^2}{2 d}+\frac {\left (a b+b^2\right ) \log (1-c-d x)}{2 d}+\frac {\left (-a b+b^2\right ) \log (1+c+d x)}{2 d}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(271\) vs.
\(2(89)=178\).
time = 0.08, size = 272, normalized size = 2.86
method | result | size |
derivativedivides | \(\frac {\frac {e \left (d x +c \right )^{2} a^{2}}{2}+\frac {e \,b^{2} \left (d x +c \right )^{2} \arctanh \left (d x +c \right )^{2}}{2}+e \,b^{2} \left (d x +c \right ) \arctanh \left (d x +c \right )+\frac {e \,b^{2} \arctanh \left (d x +c \right ) \ln \left (d x +c -1\right )}{2}-\frac {e \,b^{2} \arctanh \left (d x +c \right ) \ln \left (d x +c +1\right )}{2}-\frac {e \,b^{2} \ln \left (d x +c -1\right ) \ln \left (\frac {d x}{2}+\frac {c}{2}+\frac {1}{2}\right )}{4}+\frac {e \,b^{2} \ln \left (d x +c -1\right )^{2}}{8}+\frac {e \,b^{2} \ln \left (d x +c -1\right )}{2}+\frac {e \,b^{2} \ln \left (d x +c +1\right )}{2}-\frac {e \,b^{2} \ln \left (-\frac {d x}{2}-\frac {c}{2}+\frac {1}{2}\right ) \ln \left (d x +c +1\right )}{4}+\frac {e \,b^{2} \ln \left (-\frac {d x}{2}-\frac {c}{2}+\frac {1}{2}\right ) \ln \left (\frac {d x}{2}+\frac {c}{2}+\frac {1}{2}\right )}{4}+\frac {e \,b^{2} \ln \left (d x +c +1\right )^{2}}{8}+b a e \left (d x +c \right )^{2} \arctanh \left (d x +c \right )+e \left (d x +c \right ) a b +\frac {b a e \ln \left (d x +c -1\right )}{2}-\frac {b a e \ln \left (d x +c +1\right )}{2}}{d}\) | \(272\) |
default | \(\frac {\frac {e \left (d x +c \right )^{2} a^{2}}{2}+\frac {e \,b^{2} \left (d x +c \right )^{2} \arctanh \left (d x +c \right )^{2}}{2}+e \,b^{2} \left (d x +c \right ) \arctanh \left (d x +c \right )+\frac {e \,b^{2} \arctanh \left (d x +c \right ) \ln \left (d x +c -1\right )}{2}-\frac {e \,b^{2} \arctanh \left (d x +c \right ) \ln \left (d x +c +1\right )}{2}-\frac {e \,b^{2} \ln \left (d x +c -1\right ) \ln \left (\frac {d x}{2}+\frac {c}{2}+\frac {1}{2}\right )}{4}+\frac {e \,b^{2} \ln \left (d x +c -1\right )^{2}}{8}+\frac {e \,b^{2} \ln \left (d x +c -1\right )}{2}+\frac {e \,b^{2} \ln \left (d x +c +1\right )}{2}-\frac {e \,b^{2} \ln \left (-\frac {d x}{2}-\frac {c}{2}+\frac {1}{2}\right ) \ln \left (d x +c +1\right )}{4}+\frac {e \,b^{2} \ln \left (-\frac {d x}{2}-\frac {c}{2}+\frac {1}{2}\right ) \ln \left (\frac {d x}{2}+\frac {c}{2}+\frac {1}{2}\right )}{4}+\frac {e \,b^{2} \ln \left (d x +c +1\right )^{2}}{8}+b a e \left (d x +c \right )^{2} \arctanh \left (d x +c \right )+e \left (d x +c \right ) a b +\frac {b a e \ln \left (d x +c -1\right )}{2}-\frac {b a e \ln \left (d x +c +1\right )}{2}}{d}\) | \(272\) |
risch | \(\frac {e \,b^{2} \left (d^{2} x^{2}+2 c d x +c^{2}-1\right ) \ln \left (d x +c +1\right )^{2}}{8 d}+\frac {b e \left (-b \,d^{2} x^{2} \ln \left (-d x -c +1\right )+2 a \,d^{2} x^{2}-2 b d x \ln \left (-d x -c +1\right ) c +4 a d x c -\ln \left (-d x -c +1\right ) b \,c^{2}+2 b d x +b \ln \left (-d x -c +1\right )\right ) \ln \left (d x +c +1\right )}{4 d}+\frac {e d \,b^{2} x^{2} \ln \left (-d x -c +1\right )^{2}}{8}+\frac {e \,b^{2} c x \ln \left (-d x -c +1\right )^{2}}{4}-\frac {e d a b \,x^{2} \ln \left (-d x -c +1\right )}{2}+\frac {e \,b^{2} c^{2} \ln \left (-d x -c +1\right )^{2}}{8 d}-e a b c x \ln \left (-d x -c +1\right )+\frac {a^{2} d e \,x^{2}}{2}+\frac {e \ln \left (-d x -c -1\right ) a b \,c^{2}}{2 d}-\frac {e \ln \left (d x +c -1\right ) a b \,c^{2}}{2 d}-\frac {e \,b^{2} x \ln \left (-d x -c +1\right )}{2}+e \,a^{2} c x +\frac {e \ln \left (-d x -c -1\right ) b^{2} c}{2 d}-\frac {e \ln \left (d x +c -1\right ) b^{2} c}{2 d}-\frac {e \,b^{2} \ln \left (-d x -c +1\right )^{2}}{8 d}+b a e x -\frac {e \ln \left (-d x -c -1\right ) a b}{2 d}+\frac {e \ln \left (-d x -c -1\right ) b^{2}}{2 d}+\frac {e \ln \left (d x +c -1\right ) a b}{2 d}+\frac {e \ln \left (d x +c -1\right ) b^{2}}{2 d}\) | \(441\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 320 vs.
\(2 (94) = 188\).
time = 0.44, size = 320, normalized size = 3.37 \begin {gather*} \frac {1}{2} \, a^{2} d x^{2} e + \frac {1}{2} \, {\left (2 \, x^{2} \operatorname {artanh}\left (d x + c\right ) + d {\left (\frac {2 \, x}{d^{2}} - \frac {{\left (c^{2} + 2 \, c + 1\right )} \log \left (d x + c + 1\right )}{d^{3}} + \frac {{\left (c^{2} - 2 \, c + 1\right )} \log \left (d x + c - 1\right )}{d^{3}}\right )}\right )} a b d e + a^{2} c x e + \frac {{\left (2 \, {\left (d x + c\right )} \operatorname {artanh}\left (d x + c\right ) + \log \left (-{\left (d x + c\right )}^{2} + 1\right )\right )} a b c e}{d} + \frac {{\left (b^{2} d^{2} x^{2} e + 2 \, b^{2} c d x e + {\left (c^{2} - 1\right )} b^{2} e\right )} \log \left (d x + c + 1\right )^{2} + {\left (b^{2} d^{2} x^{2} e + 2 \, b^{2} c d x e + {\left (c^{2} - 1\right )} b^{2} e\right )} \log \left (-d x - c + 1\right )^{2} + 4 \, {\left (b^{2} d x e + b^{2} {\left (c + 1\right )} e\right )} \log \left (d x + c + 1\right ) - 2 \, {\left (2 \, b^{2} d x e + 2 \, b^{2} {\left (c - 1\right )} e + {\left (b^{2} d^{2} x^{2} e + 2 \, b^{2} c d x e + {\left (c^{2} - 1\right )} b^{2} e\right )} \log \left (d x + c + 1\right )\right )} \log \left (-d x - c + 1\right )}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 333 vs.
\(2 (94) = 188\).
time = 0.40, size = 333, normalized size = 3.51 \begin {gather*} \frac {{\left ({\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - b^{2}\right )} \cosh \left (1\right ) + {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2} - b^{2}\right )} \sinh \left (1\right )\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )^{2} + 4 \, {\left (a^{2} d^{2} x^{2} + 2 \, {\left (a^{2} c + a b\right )} d x\right )} \cosh \left (1\right ) + 4 \, {\left ({\left (a b c^{2} + b^{2} c - a b + b^{2}\right )} \cosh \left (1\right ) + {\left (a b c^{2} + b^{2} c - a b + b^{2}\right )} \sinh \left (1\right )\right )} \log \left (d x + c + 1\right ) - 4 \, {\left ({\left (a b c^{2} + b^{2} c - a b - b^{2}\right )} \cosh \left (1\right ) + {\left (a b c^{2} + b^{2} c - a b - b^{2}\right )} \sinh \left (1\right )\right )} \log \left (d x + c - 1\right ) + 4 \, {\left ({\left (a b d^{2} x^{2} + {\left (2 \, a b c + b^{2}\right )} d x\right )} \cosh \left (1\right ) + {\left (a b d^{2} x^{2} + {\left (2 \, a b c + b^{2}\right )} d x\right )} \sinh \left (1\right )\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1}\right ) + 4 \, {\left (a^{2} d^{2} x^{2} + 2 \, {\left (a^{2} c + a b\right )} d x\right )} \sinh \left (1\right )}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 238 vs.
\(2 (83) = 166\).
time = 1.10, size = 238, normalized size = 2.51 \begin {gather*} \begin {cases} a^{2} c e x + \frac {a^{2} d e x^{2}}{2} + \frac {a b c^{2} e \operatorname {atanh}{\left (c + d x \right )}}{d} + 2 a b c e x \operatorname {atanh}{\left (c + d x \right )} + a b d e x^{2} \operatorname {atanh}{\left (c + d x \right )} + a b e x - \frac {a b e \operatorname {atanh}{\left (c + d x \right )}}{d} + \frac {b^{2} c^{2} e \operatorname {atanh}^{2}{\left (c + d x \right )}}{2 d} + b^{2} c e x \operatorname {atanh}^{2}{\left (c + d x \right )} + \frac {b^{2} c e \operatorname {atanh}{\left (c + d x \right )}}{d} + \frac {b^{2} d e x^{2} \operatorname {atanh}^{2}{\left (c + d x \right )}}{2} + b^{2} e x \operatorname {atanh}{\left (c + d x \right )} + \frac {b^{2} e \log {\left (\frac {c}{d} + x + \frac {1}{d} \right )}}{d} - \frac {b^{2} e \operatorname {atanh}^{2}{\left (c + d x \right )}}{2 d} - \frac {b^{2} e \operatorname {atanh}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\c e x \left (a + b \operatorname {atanh}{\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 351 vs.
\(2 (89) = 178\).
time = 0.42, size = 351, normalized size = 3.69 \begin {gather*} \frac {1}{4} \, {\left (\frac {{\left (d x + c + 1\right )} b^{2} e \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )^{2}}{{\left (\frac {{\left (d x + c + 1\right )}^{2} d^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {2 \, {\left (d x + c + 1\right )} d^{2}}{d x + c - 1} + d^{2}\right )} {\left (d x + c - 1\right )}} - \frac {2 \, b^{2} e \log \left (-\frac {d x + c + 1}{d x + c - 1} + 1\right )}{d^{2}} + \frac {2 \, b^{2} e \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )}{d^{2}} + \frac {2 \, {\left (\frac {2 \, {\left (d x + c + 1\right )} a b e}{d x + c - 1} + \frac {{\left (d x + c + 1\right )} b^{2} e}{d x + c - 1} - b^{2} e\right )} \log \left (-\frac {d x + c + 1}{d x + c - 1}\right )}{\frac {{\left (d x + c + 1\right )}^{2} d^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {2 \, {\left (d x + c + 1\right )} d^{2}}{d x + c - 1} + d^{2}} + \frac {4 \, {\left (\frac {{\left (d x + c + 1\right )} a^{2} e}{d x + c - 1} + \frac {{\left (d x + c + 1\right )} a b e}{d x + c - 1} - a b e\right )}}{\frac {{\left (d x + c + 1\right )}^{2} d^{2}}{{\left (d x + c - 1\right )}^{2}} - \frac {2 \, {\left (d x + c + 1\right )} d^{2}}{d x + c - 1} + d^{2}}\right )} {\left ({\left (c + 1\right )} d - {\left (c - 1\right )} d\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.56, size = 432, normalized size = 4.55 \begin {gather*} x\,\left (a\,e\,\left (b+3\,a\,c\right )-2\,a^2\,c\,e\right )+{\ln \left (1-d\,x-c\right )}^2\,\left (\frac {b^2\,c\,e\,x}{4}-\frac {b^2\,e-b^2\,c^2\,e}{8\,d}+\frac {b^2\,d\,e\,x^2}{8}\right )-\ln \left (1-d\,x-c\right )\,\left (\ln \left (c+d\,x+1\right )\,\left (\frac {b^2\,c\,e\,x}{2}-\frac {\frac {b^2\,e}{2}-\frac {b^2\,c^2\,e}{2}}{2\,d}+\frac {b^2\,d\,e\,x^2}{4}\right )-\frac {x\,\left (4\,b^2\,d^2\,e\,\left (c-1\right )-4\,b^2\,d\,e\,\left (d\,\left (c-1\right )+d\,\left (c+1\right )\right )+8\,b^2\,c\,d^2\,e\right )}{16\,d^2}+\frac {x\,\left (8\,b\,d^2\,e\,\left (4\,a\,c-2\,a+b\,c\right )+4\,b\,d^2\,e\,\left (4\,a+b\right )\,\left (c+1\right )-4\,b\,d\,e\,\left (d\,\left (c-1\right )+d\,\left (c+1\right )\right )\,\left (4\,a+b\right )\right )}{16\,d^2}-\frac {b^2\,d\,e\,x^2}{8}+\frac {b\,d\,e\,x^2\,\left (4\,a+b\right )}{8}\right )+{\ln \left (c+d\,x+1\right )}^2\,\left (\frac {b^2\,c\,e\,x}{4}-\frac {b^2\,e-b^2\,c^2\,e}{8\,d}+\frac {b^2\,d\,e\,x^2}{8}\right )+\frac {\ln \left (c+d\,x+1\right )\,\left (e\,b^2\,c+e\,b^2+a\,e\,b\,c^2-a\,e\,b\right )}{2\,d}+\frac {\ln \left (c+d\,x-1\right )\,\left (-e\,b^2\,c+e\,b^2-a\,e\,b\,c^2+a\,e\,b\right )}{2\,d}+d\,\ln \left (c+d\,x+1\right )\,\left (\frac {x\,\left (e\,b^2+2\,a\,c\,e\,b\right )}{2\,d}+\frac {a\,b\,e\,x^2}{2}\right )+\frac {a^2\,d\,e\,x^2}{2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________